package com.campus.commons.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.sql.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 学生信息表
 * </p>
 *
 * @author Rin
 * @since 2020-12-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Student对象", description="学生信息表")
@TableName(excludeProperty={"qq","email","gender","phone","className"})
public class Student implements Serializable {
    /**
     * 所有的学生；
     * key 学生Id
     * value 学生名称
     */
    public static Map<Integer, Student> students = new HashMap<>();
    private static final long serialVersionUID = 1L;
    private String qq;
    private String email;
    private int gender;
    private String phone;
    private String className;

    public void setClassid(Integer classid) {
        this.className = Class.classes.get(classid).getClassname();
        this.classid = classid;
    }

    @ApiModelProperty(value = "学生ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "学生姓名")
    @TableField("stuName")
    private String stuname;

    @ApiModelProperty(value = "班级ID")
    @TableField("classId")
    private Integer classid;

    @ApiModelProperty(value = "用户id")
    @TableField("userId")
    private Integer userid;

    @ApiModelProperty(value = "身份证")
    @TableField("idCard")
    private String idcard;

    @ApiModelProperty(value = "家庭地址")
    private String address;

    @ApiModelProperty(value = "出生日期")
    private Date birthday;

    @ApiModelProperty(value = "入学时间")
    @TableField("createTime")
    private Date createtime;


}
